<template>
  <u-popup
    mode="bottom"
    v-model="showPopup"
    :z-index="121"
    safe-area-inset-bottom
  >
    <view class="pop">
      <view class="popup-title">
        <view class="let"
          >{{ $t("videoGoods.detail.RELATEDPRODUCTS")
          }}<view class="span"
            >({{
              $t("order.total1") + goodsList.count + $t("order.total2")
            }})</view
          ></view
        >

        <i class="iconfont icon-close" @click="showPopup = false"></i>
      </view>
      <scroll-view scroll-y class="scrollY">
        <goods :list="goodsList.list" :videoId="videoId" :showByText="true"></goods>
      </scroll-view>
    </view>
  </u-popup>
</template>

<script>
import goods from "../../components/goods.vue";

export default {
  components: {
    goods,
  },
  props: {
    items: {
      type: Array,
      default() {
        return [];
      },
    },
    videoId: {
      type: [Number, String],
      default: undefined,
    },
  },

  data() {
    return {
      showPopup: false,
      goodsList: {
        count: 0,
        list: [],
      },
    };
  }
};
</script>

<style scoped lang="less">
.scrollY {
  max-height: 50vh;
}

.popup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26rpx 0;

  .let {
    display: flex;
    align-items: flex-end;
    font-size: 32rpx;
    color: #262626;
    font-weight: bold;

    .span {
      padding-left: 10rpx;
      font-size: 24rpx;
      color: #999;
      font-weight: normal;
    }
  }

  .iconfont {
    color: #262626;
  }
}

.pop {
  padding: 15rpx 36rpx;
}
</style>
